Security News
NVD Backlog Tops 20,000 CVEs Awaiting Analysis as NIST Prepares System Updates
NVD’s backlog surpasses 20,000 CVEs as analysis slows and NIST announces new system updates to address ongoing delays.
@material/button
Advanced tools
The MDC Button component is a spec-aligned button component adhering to the
Material Design button requirements.
It works without JavaScript with basic functionality for all states.
You can enhance the button to have ripple effects by instantiating MDCRipple
on
the button
element. See MDC Ripple and Demo for details.
npm install --save @material/button
Note: Examples and documents use generic
<button>
, but users can also applymdc-button
to<a class="mdc-button">Link Button</a>
in cases where it is semantically correct.
<button class="mdc-button">
Text button
</button>
<button class="mdc-button mdc-button--raised">
Raised button
</button>
<button class="mdc-button mdc-button--unelevated">
Unelevated button
</button>
<button class="mdc-button mdc-button--stroked">
Stroked button
</button>
Users can add disabled
directly to the button element or set the fieldset containing
the button to disabled
to disable a button. Disabled buttons cannot be interacted
with and have no visual interaction effect.
<button class="mdc-button mdc-button--raised" disabled>
Raised disabled button
</button>
MDC Buttons have a default baseline color, but it is also possible to adopt the
application's primary or secondary color by adding the mdc-button--primary
or
mdc-button--accent
modifier.
Note: "Secondary" was previously called "accent" in the Material spec. See mdc-theme for details.
<button class="mdc-button mdc-button--accent">
Colored button
</button>
To add the ink ripple effect to a button, attach a ripple instance to the button element.
mdc.ripple.MDCRipple.attachTo(document.querySelector('.mdc-button'));
You can also do this declaratively when using the material-components-web package.
<button class="mdc-button" data-mdc-auto-init="MDCRipple">
Flat button
</button>
Buttons are fully aware of ripple styles, so no DOM or CSS changes are required to use them.
The block class is mdc-button
. This defines the top-level button element.
The button component has no inner elements.
The provided modifiers are:
Class | Description |
---|---|
mdc-button--raised | A contained button that is elevated upon the surface. |
mdc-button--unelevated | A contained button that is flush with the surface. |
mdc-button--stroked | A contained button that is flush with the surface and has a visible border. |
mdc-button--dense | Compresses the button text to make it slightly smaller. |
mdc-button--compact | Reduces the amount of horizontal padding in the button. |
mdc-button--primary | Colors the button with the primary color. |
mdc-button--accent | Colors the button with the secondary color. |
FAQs
The Material Components for the web button component
The npm package @material/button receives a total of 501,888 weekly downloads. As such, @material/button popularity was classified as popular.
We found that @material/button demonstrated a not healthy version release cadence and project activity because the last version was released a year ago. It has 15 open source maintainers collaborating on the project.
Did you know?
Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.
Security News
NVD’s backlog surpasses 20,000 CVEs as analysis slows and NIST announces new system updates to address ongoing delays.
Security News
Research
A malicious npm package disguised as a WhatsApp client is exploiting authentication flows with a remote kill switch to exfiltrate data and destroy files.
Security News
PyPI now supports digital attestations, enhancing security and trust by allowing package maintainers to verify the authenticity of Python packages.